package com.biaobiaoqi.scoreanalysis.administrator.action;

import java.util.List;

import javax.annotation.Resource;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.biaobiaoqi.scoreanalysis.hibernate.bean.Administrator;
import com.biaobiaoqi.scoreanalysis.service.IAdministratorService;
import com.opensymphony.xwork2.ActionSupport;

public class ListAdmin extends ActionSupport {
	Log log = LogFactory.getLog(getClass());
 	private static final long serialVersionUID = -3153691580489187791L;
 	private List<Administrator> list;
 	private int currentPage=0;
 	@Resource
 	private IAdministratorService administratorService;
 	public String execute() {
 		log.debug("listAdmin");
 		try {
 	 		list = administratorService.listAllAdministrator(currentPage*9, 9);
 	 		return SUCCESS;	
		} catch (Exception e) {
			log.error("list admin failed.", e);
			return ERROR;
		}
 	}
	public List<Administrator> getList() {
		return list;
	}
	public void setList(List<Administrator> list) {
		this.list = list;
	}
	public IAdministratorService getAdministratorService() {
		return administratorService;
	}
	public void setAdministratorService(IAdministratorService administratorService) {
		this.administratorService = administratorService;
	}
	public int getCurrentPage() {
		return currentPage;
	}
	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}

}
